import ZZEcharts from "@/utils/echart";
import "./index.scss";
export default defineComponent({
	setup(props, ctx) {
		let zzEchart = ref();
		let echartRef = ref();
		let option = {};
		const setOption = (_option: any) => {
			option = _option;
		};
		const chartInit = (flg: boolean) => {
			zzEchart.value = new ZZEcharts(option, echartRef.value);
			flg ? zzEchart.value.echartsClick() : "";
		};
		const setchartOption = (option: any) => {
			zzEchart.value.setOption(option);
		};
		const getEchartEntity = () => {
			return zzEchart.value.echartsEntity;
		};
		ctx.expose({
			setOption,
			chartInit,
			setchartOption,
			getEchartEntity
		});
		return () => <div class="echarts" ref={echartRef} id="ZZEcharts"></div>;
	}
});
